//
//  GYNewGoods.m
//  GoodLuck
//
//  Created by apple on 2018/5/2.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYNewGoods.h"

@implementation GYNewGoods


- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    NSLog(@"key =====%@",key);
}

- (NSString *)description {
    NSArray *keys = @[@"title",@"image",@"type",@"data"];
    
    return [NSString stringWithFormat:@"%@",[self dictionaryWithValuesForKeys:keys]];
}

- (CGFloat)height {
    CGFloat height = [GYAutoScale heightScale:230 originalSize:iphone6_H];
    
    CGFloat textHeight = [self.title boundingRectWithSize:CGSizeMake(ScreenWidth-40, 999) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20]} context:nil].size.height;
    
    return height+30+textHeight;
}

@end
